package com.shy.base.controller;

import java.util.Date;

import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.support.WebBindingInitializer;

import com.shy.base.util.CustomDateEditor;

/**
 * 处理web date时间格式
 * 
 * @author shy
 * @date 2016-8-23
 */
public class DateWebBindingInitializer implements WebBindingInitializer {

    /**
     * 通过自定义数据绑定实例方式，实现通过表单将日期传到后台以date格式接收
     * @param binder  web表单数据绑定binder
     */
	@Override
    public void initBinder(WebDataBinder binder) {
        binder.registerCustomEditor(Date.class, new CustomDateEditor());
    }


}
